<template>
  <el-container class="home-container">
    <el-aside :width="isCollapse ? '64px' : '210px'">
      <Aside @collapse-changed="handleCollapse" />
    </el-aside>
    <el-container>
      <el-header>
        <Header />
      </el-header>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import Aside from '@/components/Aside.vue'
import Header from '@/components/Header.vue'

export default {
  name: 'Home',
  components: {
    Aside,
    Header
  },
  data() {
    return {
      isCollapse: false
    }
  },
  methods: {
    handleCollapse(collapsed) {
      this.isCollapse = collapsed
    }
  }
}
</script>

<style lang="less" scoped>
.home-container {
  height: 100vh;
  .el-aside {
    transition: width 0.3s;
    background-color: #304156;
  }
  .el-header {
    background-color: #fff;
    border-bottom: 1px solid #ddd;
  }
  .el-main {
    background-color: #f0f2f5;
    padding: 20px;
  }
}
</style> 